const formatTime = date => {
    const year = date.getFullYear()
    const month = date.getMonth() + 1
    const day = date.getDate()
    const hour = date.getHours()
    const minute = date.getMinutes()
    const second = date.getSeconds()
  
    return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
  }
  
  const formatNumber = n => {
    n = n.toString()
    return n[1] ? n : '0' + n
  }

  enum ORDERTYPE{
    WAIT_PAY = 1,// 待付款
    WAIT_GROUP,// 待接单
    WAIT_SELLER_SEND_GOODS, // 待发货
    WAIT_BUYER_CONFIRM_GOODS,// 已发货
    TRADE_SUCCESS,// 已完成
    CLOSED,// 已关闭
    ABNORMAL,// 异常订单
    IS_PREORDER,// 预定单
  };
  
  // module.exports = {
  //   formatTime: formatTime,
  //   ORDERTYPE:ORDERTYPE
  // }
  export {
    formatTime,
    ORDERTYPE
  }